package org.tech4j.common.core.model.response;

import org.tech4j.common.core.enums.ErrorCode;

/**
 * @program: tech4j-common
 * @description:
 * @author: YuKai Fan
 * @create: 2024/9/2 14:39
 **/
public enum ResponseCode implements ErrorCode {

    /**
     * 成功
     */
    SUCCESS(0, "成功"),

    /**
     * 重复
     */
    DUPLICATED(201, "重复"),

    /**
     * 非法参数
     */
    ILLEGAL_ARGUMENT(501, "非法参数"),

    /**
     * 系统错误
     */
    SYSTEM_ERROR(500, "系统错误"),

    /**
     * 业务错误
     */
    BIZ_ERROR(502, "业务错误"),

    /**
     * 远程调用返回结果为空
     */
    REMOTE_CALL_RESPONSE_IS_NULL(400, "远程调用返回结果为空, 原因:[%s]"),

    /**
     * 远程调用返回结果失败
     */
    REMOTE_CALL_RESPONSE_IS_FAILED(400, "远程调用返回结果失败, 原因:[%s]");

    ;

    private final Integer code;
    private final String message;

    ResponseCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
